from pymilvus import  MilvusClient


client = MilvusClient(uri="http://192.168.192.171:19530")


# 创建文档集合，参数1：集合名称，参数2：向量维度
def create_collection(name,demension):
    client.create_collection(collection_name=name,demension=demension)

# 删除文档集合
def remove_collection(name):
    client.delete(collection_name=name)

# 向量插入
def insert_data(name,data):
    return client.insert(collection_name=name,data=data)

# 向量查询
def search_data(name,queryVector):
    return client.search(collection_name=name,data=queryVector,limit=10)
